import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

class CustomToast {
  static void showErrorToast(String message) {
    Fluttertoast.showToast(
      msg: message,
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.TOP, // 修改为页面偏上方显示
      timeInSecForIosWeb: 1,
      backgroundColor: Colors.redAccent, // 修改为红色
      textColor: Colors.white,
      fontSize: 13.0,
    );
  }

  static void showSuccessToast(String message) {
    Fluttertoast.showToast(
      msg: message,
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.TOP, // 修改为页面偏上方显示
      timeInSecForIosWeb: 1,
      backgroundColor: Colors.greenAccent, // 修改为绿色
      textColor: Colors.white,
      fontSize: 13.0,
    );
  }

  static void showWarningToast(String message) {
    Fluttertoast.showToast(
      msg: message,
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.TOP, // 修改为页面偏上方显示
      timeInSecForIosWeb: 1,
      backgroundColor: Colors.orangeAccent, // 修改为橙色
      textColor: Colors.white,
      fontSize: 13.0,
    );
  }
}